package com.study.juc;

import java.util.concurrent.*;

public class CompletableFutureDemo {

    public static void main(String[] args) {
        ExecutorService executorService = new ThreadPoolExecutor(5, 5,
                0L, TimeUnit.MILLISECONDS,
                new LinkedBlockingQueue<>()
        );
        CompletableFuture<String> future1 = CompletableFuture.supplyAsync(() -> {
            System.out.println("args = " + args);
            return "aaaa";
        }, executorService);

        try {
            TimeUnit.SECONDS.sleep(3);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(" main thead -------- ");
    }


}
